import { Component, TemplateRef, ViewChild, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-navigation',
  templateUrl: './navigation.component.html',
  styleUrls: ['./navigation.component.scss']
})
export class NavigationComponent implements OnInit {

  isCollapsed = false;
  triggerTemplate = null;
  @ViewChild('trigger') customTrigger: TemplateRef<void>;
  navList = [];

  constructor(private route: ActivatedRoute) { }

  ngOnInit() {
    this.navList = this.route.routeConfig.children.filter(item => item.data).map(item => item.data.nav);
    console.log(this.navList, 'erjkrgjkv');
  }

  changeTrigger(): void {
    this.triggerTemplate = this.customTrigger;
  }
}
